package suites.deeplink {
	import suites.AbstractConfig;
	import suites.stub.DeeplinkStrategyStub;
	import suites.stub.RequestProcessorStub;

	import org.flexunit.asserts.assertEquals;
	import org.flexunit.asserts.assertNotNull;
	import org.splink.deepsplink.config.ConfigDataReader;
	import org.splink.deepsplink.deeplink.DeeplinkController;
	import org.splink.deepsplink.deeplink.IDeeplinkController;

	/**
	 * @author Max Kugland
	 */
	public class AbstractDeeplinkControllerTest extends AbstractConfig {
		protected var _ctrl : IDeeplinkController;

		final protected function createCtrl(gotoFnc : Function = null) : IDeeplinkController {
			return _ctrl = new DeeplinkController(new ConfigDataReader(standardXml).read(), new RequestProcessorStub(gotoFnc), new DeeplinkStrategyStub);
		}

		[After]
		public function after() : void {
			assertNotNull(_ctrl);
			_ctrl.finalize();
			assertEquals(0, _ctrl.history.length);
		}
	}
}